package com.fast.common.util;

import java.security.MessageDigest;

import org.apache.commons.codec.binary.Hex;

public class MD5Util {

	public static String md5(String srcMsg) {
		try {
			MessageDigest digest = MessageDigest.getInstance("MD5");
			digest.update((srcMsg).getBytes("UTF-8"));
			return Hex.encodeHexString(digest.digest());
		} catch (Exception e) {
			throw new RuntimeException("md5Digest failure", e);
		}
	}
}